import Vue from 'vue'
import './cube-ui'
import App from './App.vue'
import 'amfe-flexible'
import './fonts/iconfont.js'
import './fonts/iconfont.css'
import 'animate.css';
import request from './util/request'
import router from './router'
import store from './store'

Vue.prototype.$url = request;
Vue.prototype.$sysinfo = window.sysinfo;

Vue.config.productionTip = false

if(!window.sysinfo.develop){
  Vue.prototype.$wx = window.wx;  //微信对象
  window.wx.ready(()=>{
    window.wx.hideMenuItems({
      menuList: ["menuItem:originPage","menuItem:openWithQQBrowser","menuItem:openWithSafari","menuItem:share:email","menuItem:delete"]
    });
  });
}

router.beforeEach((to,from,next)=>{
  //页面名称
  switch(to.name){
    case "home":
      document.title = window.sysinfo.web_name;
      break;
    default:
      document.title = to.meta.title;
      break;
  }
  next();
});

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
